package com.jp.knowledge.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by jiayen on 16/10/14.
 */

public class TopicListInfo implements Parcelable {


    /**
     * infoId : a2bc0869-1015-4dd3-b43b-311fd5cb16b5
     * nickName : jian
     * praiseNum : 0
     * replyData : {"uid":null,"userName":null,"content":null}
     * portrait : null
     * content : 32323
     * uid : e7ceb2d5-c85f-4fee-97c1-4635ad85c187
     * replyNum : 0
     * commentId : 8865b7a2-87ef-4416-af0c-f2c9bca681db
     * isPraise : 0
     * time : 1476953778000
     */

    private String infoId;
    private String nickName;
    private String userName;
    private int praiseNum;
    private ReplyDataBean replyData;
    private String portrait;
    private String content;
    private String uid;
    private int replyNum;
    private String commentId;
    private int isPraise;
    private long time;


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public void setPraiseNum(int praiseNum) {
        this.praiseNum = praiseNum;
    }

    public void setReplyData(ReplyDataBean replyData) {
        this.replyData = replyData;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public void setReplyNum(int replyNum) {
        this.replyNum = replyNum;
    }

    public void setCommentId(String commentId) {
        this.commentId = commentId;
    }

    public void setIsPraise(int isPraise) {
        this.isPraise = isPraise;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getInfoId() {
        return infoId;
    }

    public String getNickName() {
        return nickName;
    }

    public int getPraiseNum() {
        return praiseNum;
    }

    public ReplyDataBean getReplyData() {
        return replyData;
    }

    public String getPortrait() {
        return portrait;
    }

    public String getContent() {
        return content;
    }

    public String getUid() {
        return uid;
    }

    public int getReplyNum() {
        return replyNum;
    }

    public String getCommentId() {
        return commentId;
    }

    public int getIsPraise() {
        return isPraise;
    }

    public long getTime() {
        return time;
    }

    public static class ReplyDataBean  implements  Parcelable{
        /**
         * uid : null
         * userName : null
         * content : null
         */

        private String uid;
        private String userName;
        private String content;

        public void setUid(String uid) {
            this.uid = uid;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getUid() {
            return uid;
        }

        public String getUserName() {
            return userName;
        }

        public String getContent() {
            return content;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.uid);
            dest.writeString(this.userName);
            dest.writeString(this.content);
        }

        public ReplyDataBean() {
        }

        protected ReplyDataBean(Parcel in) {
            this.uid = in.readString();
            this.userName = in.readString();
            this.content = in.readString();
        }

        public static final Creator<ReplyDataBean> CREATOR = new Creator<ReplyDataBean>() {
            public ReplyDataBean createFromParcel(Parcel source) {
                return new ReplyDataBean(source);
            }

            public ReplyDataBean[] newArray(int size) {
                return new ReplyDataBean[size];
            }
        };
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.infoId);
        dest.writeString(this.nickName);
        dest.writeInt(this.praiseNum);
        dest.writeParcelable(this.replyData, flags);
        dest.writeString(this.portrait);
        dest.writeString(this.content);
        dest.writeString(this.uid);
        dest.writeInt(this.replyNum);
        dest.writeString(this.commentId);
        dest.writeInt(this.isPraise);
        dest.writeLong(this.time);
    }

    public TopicListInfo() {
    }

    protected TopicListInfo(Parcel in) {
        this.infoId = in.readString();
        this.nickName = in.readString();
        this.praiseNum = in.readInt();
        this.replyData = in.readParcelable(ReplyDataBean.class.getClassLoader());
        this.portrait = in.readString();
        this.content = in.readString();
        this.uid = in.readString();
        this.replyNum = in.readInt();
        this.commentId = in.readString();
        this.isPraise = in.readInt();
        this.time = in.readLong();
    }

    public static final Creator<TopicListInfo> CREATOR = new Creator<TopicListInfo>() {
        public TopicListInfo createFromParcel(Parcel source) {
            return new TopicListInfo(source);
        }

        public TopicListInfo[] newArray(int size) {
            return new TopicListInfo[size];
        }
    };
}
